package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
public class TravelQuestion {
    public static final int STATE_NORMAL = 0; // 普通问题
    public static final int STATE_HOT = 1;  // 热门问题

    private Long id;

    private User user;

    @JsonFormat(pattern = "yyyy-MM-dd ", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date releaseTime;

    private String question;

    private Integer state;

    private Region region;

    public String getStateDisplay(){
        if(state == STATE_NORMAL){
            return "普通问题";
        }else{
            return "热门问题";
        }
    }


}